﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mindfor.Web.Data;

namespace Mindfor.Web.Models
{
	/// <summary>
	/// Defines properties to store message model data.
	/// </summary>
	public class MessageModel
	{
		/// <summary>
		/// Gets or sets text message.
		/// </summary>
		public string Message { get; set; }

		/// <summary>
		/// Gets additional links to show to user.
		/// </summary>
		public Link[] Links { get; private set; }

		/// <summary>
		/// Gets or sets auto redirect seconds. Then user will be redirected to RedirectUrl.
		/// </summary>
		public int RedirectSeconds { get; set; }

		/// <summary>
		/// Gets or sets auto redirect url. If <c>Null</c> then auto redirect is off.
		/// </summary>
		public string RedirectUrl { get; set; }

		/// <summary>
		/// Initializes new model instance.
		/// </summary>
		/// <param name="message">Message to show to user.</param>
		/// <param name="links">Additional links to show to user.</param>
		public MessageModel(string message, params Link[] links)
		{
			Message = message;
			Links = links;
		}

		/// <summary>
		/// Initializes new model instance.
		/// </summary>
		/// <param name="message">Message to show to user.</param>
		/// <param name="redirectSeconds">Auto redirect seconds. Then user will be redirected to RedirectUrl.</param>
		/// <param name="redirectUrl">Auto redirect url. If <c>Null</c> then auto redirect is off.</param>
		/// <param name="links">Additional links to show to user.</param>
		public MessageModel(string message, int redirectSeconds, string redirectUrl, params Link[] links)
			: this(message, links)
		{
			RedirectSeconds = redirectSeconds;
			RedirectUrl = redirectUrl;
		}
	}
}
